package com.yashi.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.multipart.MultipartFile;

import com.github.pagehelper.PageInfo;
import com.yashi.entity.TbUser;

public interface UserService {
	
	
	/**
	 * 查询用户聊天列表
	 * @param id
	 * @return
	 */
	List<TbUser> findUserChatList(HttpSession session);

	/**
	 * 根据用户名查询用户信息
	 * @param user
	 * @return
	 */
	TbUser selectByUser(TbUser user)throws Exception;

	/**
	 * 添加用户
	 * @param user
	 * @param session
	 * @return
	 */
	Integer addUser(TbUser user,HttpServletRequest request, HttpSession session)throws Exception ;

	/**
	 * 查询所有用户
	 * @return
	 */
	PageInfo<TbUser> findUserList(Integer pageNum)throws Exception ;

	/**
	 * 修改用户信息
	 * @param user
	 * @return
	 */
	Integer updateUser(TbUser user,HttpSession session)throws Exception;

	/**
	 * 逻辑删除
	 * @param user
	 * @return
	 */
	Integer deleteUser(TbUser user)throws Exception;

	/**
	 * 根据用户Id来查询
	 * @param userId
	 * @return
	 */
	TbUser selectUserById(String userId)throws Exception;

	/**
	 * 根据用户名模糊查询
	 * @param userName
	 * @return
	 */
	PageInfo<TbUser> selectUserByName(String userName,Integer pageNum)throws Exception;

	/**
	 * 修改密码
	 * @param userId
	 * @param password
	 * @param confirmPass
	 * @return
	 */
	Integer updatePass(String userId, String oldPassword, String newPassword, String confirmPass)throws Exception;

	/**
	 * 根据用户Id修改用户头像
	 * @param userId
	 * @param file
	 * @param request
	 * @return
	 */
	String modifyImg(String userId, MultipartFile file, HttpServletRequest request,HttpSession session);

	/**
	 * App端查询所有用户
	 * @return
	 */
	List<TbUser> findUserList1();

	/**
	 * App端模糊查询
	 * @param userName
	 */
	List<TbUser> selectUserByName1(TbUser user);

	/**
	 * 根据Id查询用户
	 * @param userId
	 * @return
	 */
	TbUser findUserById(String userId);

	/**
	 * 设为管理员
	 * @param userId
	 * @return
	 */
	TbUser addAdmin(TbUser user);

	/**
	 * web端登陆验证
	 * @param user
	 * @return
	 */
	TbUser selectByUser1(TbUser user) throws Exception;

	
}
